﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleModeler
{
    /// <summary>
    /// Stellt 4 Bytes dar (zur Repräsentation von ARGB-Werten)
    /// </summary>
    public struct Byte4
    {
        /// <summary>
        /// ARGB-Bytes
        /// </summary>
        public byte R, G, B, A;

        /// <summary>
        /// Initialisator
        /// </summary>
        /// <param name="input">Input</param>
        public Byte4(byte[] input)
        {
            R = input[0];
            G = input[1];
            B = input[2];
            A = input[3];
        }

        /// <summary>
        /// Wandelt den Wert in einen unsigned integer um
        /// </summary>
        /// <returns>unsigned integer</returns>
        public uint ToUInt32()
        {
            byte[] temp = new byte[] { this.R, this.G, this.B, this.A };
            return BitConverter.ToUInt32(temp, 0);
        }

        /// <summary>
        /// Stringrepräsentation
        /// </summary>
        /// <returns>Stringrepräsentation</returns>
        public override string ToString() { return this.R + ", " + this.G + ", " + this.B + ", " + this.A; }
    }
}
